package com.haoshuang.zhouzhoubang.ui.dialog

import android.content.Context
import com.haoshuang.zhouzhoubang.R
import com.haoshuang.zhouzhoubang.databinding.DialogNoticePushBinding
import com.lxj.xpopup.core.CenterPopupView
import com.mufeng.libs.utils.startPage
import com.mufeng.libs.utils.view.clickWithTrigger

class NoticePushDialog(context: Context, private val onConfirm: () -> Unit): CenterPopupView(context) {

    private lateinit var binding: DialogNoticePushBinding

    override fun getImplLayoutId(): Int {
        return R.layout.dialog_notice_push
    }

    override fun onCreate() {
        super.onCreate()
        binding = DialogNoticePushBinding.bind(popupImplView)

        binding.tvContent.text = "推送功能要获取手机标识信息,设备信息等,不同意将无法使用推送功能.将会影响实时接收任务需求信息功能"
        binding.tvPushPermissionDescription.clickWithTrigger{
//            context.startPage<PushPermissionDescriptionActivity>()
        }

        binding.tvCancel.clickWithTrigger { dismiss() }
        binding.tvConfirm.clickWithTrigger {
            dismiss()
            onConfirm()
        }
    }

}